package com.qiangesoft.blog.file.core.local;

import com.qiangesoft.blog.common.constants.Constants;
import com.qiangesoft.blog.file.model.FileInfoVo;
import org.springframework.web.multipart.MultipartFile;

import java.io.InputStream;

/**
 * 文件服务接口
 *
 * @author qiange
 * @date 2023-04-28
 */
public interface LocalFileService {

    default String fileSeparator() {
        return Constants.SLASH;
    }

    void validFiles(MultipartFile[] files);

    Boolean createFolder(String path);

    FileInfoVo uploadFile(MultipartFile file, String path);

    FileInfoVo uploadFile(InputStream inputStream, String contentType, String path);

    byte[] downloadByFilePath(String path);

    byte[] downloadFileByUrl(String url);

    void deleteByFilePath(String path);
}
